<div id="shopping_cart" class="full_page">
    <ul class="breadcrumb">
        <li><a href="#">Home</a></li>
        <li><?php echo $data_product->kategori_nama; ?></li>
        <li class="active"><?php echo $data_product->produk_nama; ?></li>
    </ul>
	<div id="product_detail"> 
		<div class="product_leftcol">
			<img src="<?php echo base_url() . "uploads/images/" . $data_product->produk_sampul; ?>">
		</div>
		<div class="product_rightcol">
			<small class="pr_type"><?php echo $data_product->kategori_nama; ?></small>
			<h1><?php echo $data_product->produk_nama; ?></h1>
			<p class="short_dc">
				<?php echo $data_product->produk_deskripsi; ?>
			</p>
			<div class="pr_price">
				<big>Rp. <?php echo number_format($data_product->produk_harga,2,',','.'); ?></big>
			</div>
			<div class="add_to_buttons">
				<button onClick="parent.location='leisure_cart.html'" class="add_cart">Add to Cart</button>
			</div>
		</div>
	</div>
</div>
<!--MAIN CONTENT ENDS-->
<script language="javascript">
	var addtocart = null;
</script>
<script type="text/javascript">
$(document).ready(function(){
	/* VARIABLE STARTS */
	my_config['main_content'] = $("#main_content");
	/* VARIABLE ENDS */
	/* ACTION HANDLER STARTS */
	function addcart(pid){
		$.ajax({
			url : 'index.php/c_product/addtocart',
			type : 'POST',
			dataType : 'json',
			data : {
				pid : pid,
				q : '1'
			},success : function(data){
				var sum_item = $("#cart_sumitem").text();
				var sum_itemprice = $("#cart_sumprice").text();
				var list_item = $("#cart_listofitems").html();
				var new_sumitem = eval(sum_item) + 1;
				var new_sumitemprice = eval(sum_itemprice) + eval(data[0].produk_harga);
				var new_listitem = '<li><img width="82" height="82" src="<?php echo base_url(); ?>uploads/images/' + data[0].produk_sampul + '"><a href="#">' + data[0].produk_nama + '</a> <span class="price">Rp. ' + data[0].produk_harga + '</span></li>';
				$("#cart_sumitem").empty();
				$("#cart_sumprice").empty();
				$("#cart_listofitems").empty();
				$("#cart_subtotal").empty();
				$("#cart_sumitem").text(new_sumitem);
				$("#cart_sumprice").text(new_sumitemprice);
				$("#cart_listofitems").html(new_listitem + list_item);
				$("#cart_subtotal").text(new_sumitemprice);
			}
		});
	}
	addtocart = addcart;
	/* ACTION HANDLER ENDS */
});
</script>